﻿#region Usings
using BK.Model;
using BK.Repositories.Abstract;
#endregion

namespace BK.BlusinessLogic
{
    public class FinancistoExpensesBl : BaseExpensesBl<FinancistoExpense, FinancistoFile>
    {
        #region C'tors
        public FinancistoExpensesBl(IExpensesRepository<FinancistoExpense> expensesRepository,
            IImportStatusesRepository importStatusesRepository,
            IAccountsRepository accountsRepository,
            IExpensesFilesRepository<FinancistoExpense, FinancistoFile> expensesFilesRepository,
            ICategoriesRepository categoriesRepository,
            ICurrenciesRepository currenciesRepository,
            ITargetsRepository targetsRepository, 
            IPaymentsRepository paymentsRepository)
            : base(expensesRepository, importStatusesRepository, accountsRepository, expensesFilesRepository,
                categoriesRepository, currenciesRepository, targetsRepository, paymentsRepository)
        {
        }
        #endregion

        protected override IExpensesFilesBl<FinancistoExpense, FinancistoFile> CreateExpensesFilesBl(IExpensesFilesRepository<FinancistoExpense, FinancistoFile> expensesFilesRepository)
        {
            return new FinancistoFilesBl(expensesFilesRepository);
        }

        protected override Target GetRootTarget(User user, FinancistoExpense expense)
        {
            return new Target
            {

                Name = expense.Project,
                Parent = null,
                User = user
            };
        }
    }
}